#ifndef IP_DECODER_H
#define IP_DECODER_H

#include "netstruct.h"

class IPDecoder
{
public:
	//Constructor
	IPDecoder();
	IPDecoder(const u_char * packetcontent);
	~IPDecoder();
	
	//Decode data
	unsigned short GetIPVersion();
	unsigned int GetHeadLength();
	unsigned int GetTotalLength();
	unsigned int GetIdentification();
	unsigned short GetTimeToLive();
	unsigned short GetProtocol();
	unsigned int GetChecksum();
	char * GetDstAddr();
	char * GetSrcAddr();
	
protected:
	//Getting private member
	iphdr* GetIPHead();
private:
	iphdr* pIPHead;
};

#endif